/*
 * @Descripttion:
 * @version:
 * @Author: ChenXiang
 * @Date: 2021-04-16 16:03:52
 * @LastEditors: ChenXiang
 * @LastEditTime: 2021-08-13 15:49:00
 */
import React, { useEffect } from "react";
import { useLocation, useHistory, useParams } from "react-router-dom";
import { Button } from "antd";

function Detail(props) {
  const history = useHistory();
  const { state } = useLocation();
  useEffect(() => {
    console.log("1");
    console.log(props);
  }, []);

  console.log("state", state);

  const backPage = () => {
    // 带回给 A 页面
    // history.push({
    //   pathname: "/keep/useLocation",
    //   state
    // });
  };

  return (
    <>
      state.value:{state?.value}
      <Button onClick={backPage}>返回</Button>
    </>
  );
}

export default Detail;
